﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:n="http://nRoute/schemas/2010/xaml" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:TabsNavigation_Behaviors="clr-namespace:TabsNavigation.Behaviors"
	x:Class="TabsNavigation.MainPage"
    d:DesignWidth="800" d:DesignHeight="500" mc:Ignorable="d">
    
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>

    <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">

        <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}"/>

    	<Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">

    		<Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}" BorderBrush="{x:Null}" BorderThickness="0" Margin="-18,55,25,0">
    			<ItemsControl ItemsSource="{Binding SiteMapNodes}">
    				<ItemsControl.ItemsPanel>
    					<ItemsPanelTemplate>
    						<StackPanel Style="{StaticResource LinksStackPanelStyle}" />
    					</ItemsPanelTemplate>       		
    				</ItemsControl.ItemsPanel>	        	
    				<ItemsControl.ItemTemplate>
    					<DataTemplate>
    						<HyperlinkButton Style="{StaticResource LinkStyle}" Content="{Binding Title}" 
    							ToolTipService.ToolTip="{Binding Description}">
    							<i:Interaction.Triggers>
    								<i:EventTrigger EventName="Click">
    									<n:ExecuteSiteMapNodeAction SiteMapNode="{Binding}"/>
    								</i:EventTrigger>
    							</i:Interaction.Triggers>
    						</HyperlinkButton>
    					</DataTemplate>
    				</ItemsControl.ItemTemplate>
    			</ItemsControl>                
    		</Border>

    		<Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}" Margin="12,0,20,10">
    			<StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
    				<ContentControl Style="{StaticResource LogoIcon}"/>
    				<TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" Text="Application Name"/>
    			</StackPanel>
    		</Border>
    		<Button Content="r" HorizontalAlignment="Right" Height="30" Margin="0,8,16,0" VerticalAlignment="Top" Width="30" FontFamily="Webdings" Style="{StaticResource ImageButton}" Foreground="#FFB2AFAF" Padding="2.5,1,2.5,2.5" FontSize="12">
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="Click">
    					<TabsNavigation_Behaviors:CloseActiveTabAction TargetObject="{Binding ElementName=tabControl}"/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    		</Button>

    	</Grid>

    	<sdk:TabControl x:Name="tabControl" Margin="12,135,12,12" BorderThickness="0"> 
    		<i:Interaction.Behaviors>
    			<TabsNavigation_Behaviors:TabControlNavigationAdapter/>
    			<n:NavigationHandlerBehavior IsDefaultHandler="True"/>
    		</i:Interaction.Behaviors> 
    	</sdk:TabControl>

    </Grid>

</UserControl>